home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 039a / imc9104.zip / MOUSE4A.C < prev    next >
Text File  |  1991-03-05  |  979b  |  36 lines

  1. /*******************************************************************
  2. * Customizing the graphics mouse cursor: code from Figure 4A       *
  3. *******************************************************************/
  4. #include <conio.h>  /* kbhit(), getch()     */
  5. #include <dos.h>    /* int86(), union REGS  */
  6. #include <stdio.h>  /* puts()               */
  7. #include <stdlib.h> /* exit(), EXIT_FAILURE */
  8.  
  9. void main(void)
  10.     {
  11.     union REGS regs;
  12.  
  13.     /* Initialize the mouse */
  14.     regs.x.ax = 0x00;
  15.     int86(0x33, ®s, ®s);
  16.     if (!regs.x.ax)
  17.         {
  18.         puts("ERROR-can't initialize mouse");
  19.         exit(EXIT_FAILURE);
  20.         }
  21.  
  22.     /* Show the mouse */
  23.     regs.x.ax = 0x01;
  24.     int86(0x33, ®s, ®s);
  25.  
  26.     /* Wait for the user to quit */
  27.     puts("You can now see the mouse");
  28.     puts("Press any key to quit");
  29.     while ( !kbhit() )
  30.         ;
  31.  
  32.     /* Hide the mouse */
  33.     regs.x.ax = 0x02;
  34.     int86(0x33, ®s, ®s);
  35.     }
  36.